<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%
    String path = request.getContextPath();
    String basePath =
            request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html>
<head>
    <base href="<%=basePath%>">
    <meta charset="UTF-8">
    <title>Insert title here</title>
    <link href="static/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<form:form cssClass="form-horizontal" modelAttribute="user" method="post"
           action="user/save">
    <div class="form-group">
        <label class="col-sm-4 control-label"></label>
        <div class="col-sm-4">
            <h2>添加一个用户</h2>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-4 control-label">用户名:</label>
        <div class="col-sm-4">
            <form:input path="userName" cssClass="form-control"/>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-4 control-label">爱好:</label>
        <div class="col-sm-4">
            <form:checkboxes items="${hobbys}" path="hobby"/>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-4 control-label">朋友:</label>
        <div class="col-sm-4">


            <form:checkbox path="friends" value="张三"/>张三
            <form:checkbox path="friends" value="李四"/>李四
            <form:checkbox path="friends" value="王五"/>王五
            <form:checkbox path="friends" value="赵六"/>赵六
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-4 control-label">职业:</label>
        <div class="col-sm-4">
            <form:select path="carrer" cssClass="form-control">
                <form:option value="" label="请选择职业"/>
                <form:options items="${carrers }"/>
            </form:select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-4 control-label">户籍:</label>
        <div class="col-sm-4">
            <form:select path="houseRegister" cssClass="form-control">
                <form:option value="" label="请选择户籍"/>
                <form:options items="${houseRegisters }"/>
            </form:select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-4 control-label">个人描述:</label>
        <div class="col-sm-4">
            <form:textarea path="remark" rows="5" cssClass="form-control"/>
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-5 col-sm-6">
            <button type="submit" class="btn btn-success">添加</button>
            <button type="reset" class="btn btn-primary">重置</button>
        </div>
    </div>
</form:form>
</body>
</html>